﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Game_Engine
{
    public class Sprite
    {
        public Texture2D Texture
        {
            get;
            set;
        }

        public Vector2 Position
        {
            get;
            set;
        }

        public Rectangle Source
        {
            get;
            set;
        }

        public Color Color
        {
            get;
            set;
        }
        public float Rotation
        {
            get;
            set;
        }

        public Vector2 Origin
        {
            get;
            set;
        }

        public Vector2 Scale
        {
            get;
            set;
        }

        public SpriteEffects Effects
        {
            get;
            set;
        }

        public float Depth
        {
            get;
            set;
        }

        public Sprite(Texture2D texture)
        {
            Texture = texture;
            Position = Vector2.Zero;
            Source = new Rectangle(0, 0, texture.Width, texture.Height);
            Color = Color.Wheat;
            Rotation = 0;
            Origin = new Vector2(0, 0);
            Scale = Vector2.One;
            Effects = SpriteEffects.None;
            Depth = 0;
        }

        public Sprite()
        {

        }

        public virtual void Update()
        {

        }

        //This function saves us time in drawing by dsving us from plugging in nine? 
        //parameters to the SpriteBatch.Draw(nine!) function
        public virtual void Draw(SpriteBatch sB)
        {
            sB.Draw(Texture, Position, Source, Color, Rotation, Origin, Scale, Effects, Depth);
        }
    }
}
